home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MIDICraft's MIDINET CD-ROM
/
MIDICraft's MIDINET CD-ROM.iso
/
DOSUTILS
/
MIDI2HEX.DOC
< prev
next >
Wrap
Text File
|
1996-08-27
|
4KB
|
131 lines
******************************
MIDI2HEX v1.1
midi binaries to hexdump
by Guenter Nagler
1995
(gnagler@ihm.tu-graz.ac.at)
******************************
[1] BACKGROUND
I wrote some midi utilities that produced midi.
For debugging purpose needed a utility to see a hexadecimal view
of the file that supports midi command seperation.
Now I use this utility to see why some of the midi files that I get
are broken.
This utility shows internals of midi, how byte sequences build
midi commands. See MIDI2TXT converter for further midi details.
[2] FILES DESCRIPTION
MIDI2HEX.EXE.........converter program
MIDI2HEX.DOC.........this file, showing usage of MIDI2HEX.EXE
MIDIIO.HPP..........header file for a c++ midi parser
MIDIIO.CPP..........source code for a c++ midi parser
MIDI2HEX.CPP.........c++ source code for midi to text
MIDI2HEX.MAK.........make file for project
MIDI2HEX.CFG.........compiler options for make
MIDI2HEX.PRJ.........project for borland c++ compilers
only MIDI2HEX.EXE is required to run program
[3] COPYRIGHT
MIDI2HEX (c) 1995 was created by Guenter Nagler.
MIDI2HEX is free and may be used as you wish with this one exception:
You may NOT charge any fee or derive any profit for distribution
of MIDI2HEX. Thus, you may NOT sell or bundle MIDI2HEX with any
product in a retail environment (shareware disk distribution, CD-ROM,
etc.) without permission of the author.
You may give MIDI2HEX to your friends, upload it to a BBS, or ftp it to
another internet site, as long as you don't charge anything for it.
[4] DISCLAIMER
MIDI2HEX was designed to handle 100% compatible standard midi files.
So I give no guarantees of the results, especially with non 100%
compatible midi files.
If you find a midi file that you think to be 100% compatible midi
that is not correctly converted, please send a sample file to
gnagler@ihm.tu-graz.ac.at .
Use MIDI2HEX at your own risk. Anything you do with MIDI2HEX is your
responsibility, and not the author's. Any damage caused to any person,
computer, software, hardware, company, or business by running MIDI2HEX
is your responsibility, and the author will not be liable.
If you don't understand these terms, or are not sure of something, or
are afraid something bad might come of using MIDI2HEX, don't use it!
You are here forewarned.
[5] INSTALLATION
[MSDOS]
Simply copy MIDI2HEX.EXE in a directory that is in your path.
When you start the program without arguments
C:\> MIDI2HEX
you should get the usage text (see next section)
[UNIX]
compile sources with your C++ compiler (e.g. GNU Compiler g++):
g++ -o midi2hex midi2hex.cpp midiio.cpp
and run program
$ midi2hex
[6] USAGE
usage: MIDI2HEX file.mid [> file.txt]
The parts in brackets [...] are optional.
The text output is normally written to screen but can be relinked
to a file (> filename.txt) or a printer (> prn). See your MS-DOS/UNIX
manual for usage of > and >> operators.
[7] A sample of resulting text output
command> midi2hex gs_reset.mid
MThd 00000006
0000 0001 0078 // format, trackcount, resolution
MTrk 0000003C
0016: 00 FF 58 04 04 02 18 08 // tact
001E: 00 FF 51 03 07 A1 20 // tempo
0025: 00 F0 0A 41 10 42 12 40 00 7F 00 41 F7 // sysex
0032: 38 F0 19 41 10 42 12 40 01 10 02 02 02 02 02 02 02 00 00 00 00 02 02 02 02 02 17 F7 // sysex
004E: 3A FF 2F 00 // end of track
The header starts at line containing MThd. The values are specified
hexadezimal ( base is 16 using digits 0123456789ABCDEF, e.g. 00 = 0, FF = 255, 100 = 256, etc.)
Each midi track starts with MTrk and is followed by midi command lines in hex:
fileoffset: pause command parameters // commandname
The pauses are midi delta values (dynamic large values,
see midi documentation for details, you find it by ftp at
ftp://ftp.cs.ruu.nl/pub/MIDI/DOC).
command> midi2hex gs_reset.mid > gs_reset.hex
This writes the above output text into the file gs_reset.hex
[8] SUGGESTIONS / COMMENTS / BUG REPORTS / QUESTIONS
WWW: http://hgiicm.tu-graz.ac.at/Cpub
contains all my dos/unix midi programs
EMAIL: gnagler@ihm.tu-graz.ac.at
[9] CHANGES
v1.0 to v1.1:
* bug fixed: meta events were limited to max. 127 bytes